<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('景区信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>景区名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>景区级别：</label>
                                <input type="text" name="level"/>
                            </li>
                            <li>
                                <label>景区类别：</label>
                                <input type="text" name="category"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lvyou:spot:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lvyou:spot:remove')}]];
        var prefix = ctx + "lvyou/spot";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "景区信息",
                columns: [{
                    radio: true
                },
                {
                    field: 'id', 
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'name', 
                    title: '景区名称'
                },
                {
                    field: 'level', 
                    title: '景区级别'
                }
                ]
            };
            $.table.init(options);
        });

        function submitHandler(index, layero) {
            var rows = $.table.selectFirstColumns();
            var name = $.table.selectColumns("name");

            $.modal.close();
            // 父页面的方法
            // parent.selectUsers();
            // 父页面的变量
            parent.$('#scenicId').val(rows.join());
            parent.$('#scenicName').val(name.join());
        }
    </script>
</body>
</html>